package com.longxi.tianjintianbao.ui.activity.patrol;

import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;

import com.flyco.tablayout.SlidingTabLayout;
import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.patrol.PatrolListAtPresenter;
import com.longxi.tianjintianbao.ui.presenter.patrol.PatrolListAtPresenter2;
import com.longxi.tianjintianbao.ui.view.patrol.IPatrolListAtView;
import com.longxi.tianjintianbao.ui.view.patrol.IPatrolListAtView2;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;

import butterknife.BindView;

public class PatrolListActivity2 extends BaseActivity<IPatrolListAtView2, PatrolListAtPresenter2> implements IPatrolListAtView2 {

    private final String TAG = "PatrolListActivity2";
    private String state = "";
    private int page = 0;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_general_refresh_list;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
    }

    @Override
    public void initListener() {
        super.initListener();
        mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(RefreshLayout refreshLayout) {
                mPresenter.getInspectionList();
            }
        });
        mRefreshLayout.autoRefresh();
    }

    @Override
    protected PatrolListAtPresenter2 createPresenter() {
        return new PatrolListAtPresenter2(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(RESULT_OK != resultCode){
            return;
        }
        mPresenter.onActivityResult(requestCode, resultCode, data);
    }
}
